home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 1030 < prev    next >
Encoding:
Text File  |  1996-08-06  |  1.7 KB  |  49 lines

  1. Path: fido.asd.sgi.com!austern
  2. From: Scott Meyers <smeyers@netcom.com>
  3. Newsgroups: comp.std.c++
  4. Subject: Template Syntax
  5. Date: 10 Apr 1996 17:06:28 PDT
  6. Organization: -
  7. Approved: austern@isolde.mti.sgi.com
  8. Message-ID: <199604102351.QAA11178@netcom15.netcom.com>
  9. NNTP-Posting-Host: isolde.mti.sgi.com
  10. X-Original-Date: Wed, 10 Apr 96 16:51:50 -0700
  11. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  12.     iQBVAwUBMWxNBky4NqrwXLNJAQHHnwH/eBDGmwumTvyq+oPd/JM33vySUZK5TG2H
  13.     zsLFeOpw6lPOqPyg6MpnOU3QvwiPN70ko0OvAIfl+6N0P8P6JNdR/Q==
  14.     =9Vom
  15. Originator: austern@isolde.mti.sgi.com
  16.  
  17. I was under the impression that the use of a template name inside the
  18. definition of a class template was implicitly considered to be qualified
  19. by the template parameter(s).  For example, I thought that in
  20.  
  21.   template <class T>
  22.   class Array {
  23.   public:
  24.     Array operator=(const Array& rhs);
  25.     ...
  26.   };
  27.   
  28. the declaration of operator= was legal, because the use of the token
  29. "Array" as a return type and a paramter was implicitly treated as if it
  30. were "Array<T>." Many compilers accept this, but I'm told that several
  31. reject it, and I can't find language in the January DWP that allows it. 
  32.  
  33.   1.  Is the above syntax valid, or must "Array" always be specified as
  34.       "Array<T>"? 
  35.  
  36.   2.  If the above is not valid, was it valid at one time (post-ARM)?
  37.       If so, when and why was it disallowed? 
  38.   
  39. Thanks,
  40.  
  41. Scott
  42. ---
  43. [ comp.std.c++ is moderated.  To submit articles: Try just posting with your 
  44.                 newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  45.   comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  46.   Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  47.   Comments? mailto:std-c++-request@ncar.ucar.edu 
  48. ]
  49.